%
% Information Literacy Text Style
%
% common settings are put here

\newif\ifNTT
\@ifundefined{gt}{\NTTtrue}{\NTTfalse}
%
\oddsidemargin=-0.2in
\evensidemargin=-0.2in
\textwidth=17.5cm
\topmargin=-0.5in
\textheight=25cm

% macros
\def\hr{\par\hbox to \textwidth{\hrulefill}}
\def\pre{\def\baselinestretch{0.7}\begin{quote}\tt\obeylines}
\def\endpre{\end{quote}}
\def\TIL{$\tilde{\ }$}
\def\UL#1{$\underline{\mbox{#1}}$}
\def\Enter{\,\fbox{\sf Enter}}

\def\boxcolumn{\@ifnextchar[{\@boxcolumn}{\@boxcolumn[\boxcolwidth]}}
\def\@boxcolumn[#1]{\bigskip\noindent%
\begin{tabular}{|c|}\hline\begin{minipage}{#1}\medskip}
\def\endboxcolumn{\medskip\end{minipage}\\\hline\end{tabular}\bigskip}

\let\thisdocument=\document
\let\endthisdocument=\enddocument

% operation
\newif\ifop@enum
\newif\ifop@item
\newif\ifop@continue
\newcounter{op@enumi}

\def\operation{\op@continuefalse
\@ifnextchar[{\op@operation[\Large\gt 操作してみよう]}
{\op@operation[\Large\gt 操作してみよう][e]}}

\long\def\op@operation[#1][#2]#3{%
\op@enumfalse\op@itemfalse\op@continuefalse
\@tfor\op@t:=#2\do{
\if\op@t e\op@enumtrue\op@itemfalse\else
\if\op@t i\op@enumfalse\op@itemtrue\else
\if\op@t c\op@continuetrue\fi\fi\fi
}
\begin{center}
\begin{tabular}{|p{\boxcolwidth}|}\hline
\ifop@continue\begin{minipage}{\boxcolwidth}\medskip\else
\vbox to 20pt{\vfill #1 《#3》}\\
\begin{minipage}{\boxcolwidth}\fi
\ifop@enum\begin{enumerate}
 \ifop@continue\setcounter{enumi}{\c@op@enumi}\else\fi
\else\ifop@item\begin{itemize}\else\fi
\fi}

\def\endoperation{\ifop@enum\end{enumerate}
\setcounter{op@enumi}{\c@enumi}
\else\ifop@item\end{itemize}\else\fi\fi
\medskip\end{minipage}\\%
\hline\end{tabular}\end{center}}

\def\Column{\op@continuefalse\small
\op@operation[\normalsize\gt コラム][]}
\let\endColumn=\endoperation

%
%\def\operationc{\begin{center}
%\begin{tabular}{|p{\boxcolwidth}|}\hline
%\begin{minipage}{\boxcolwidth}\medskip\begin{enumerate}}
%\let\endoperationc=\endoperation
%
%\def\operationi#1{\begin{center}
%\begin{tabular}{|p{\boxcolwidth}|}\hline
%\vbox to 20pt{\vfill\Large\gt 操作してみよう《#1》}\\
%\begin{minipage}{\boxcolwidth}\begin{itemize}}
%\def\endoperationi{\end{itemize}\medskip\end{minipage}\\%
%\hline\end{tabular}\end{center}}
%
%\def\operationic{\begin{center}
%\begin{tabular}{|p{\boxcolwidth}|}\hline
%\begin{minipage}{\boxcolwidth}\medskip\begin{itemize}}
%\let\endoperationic=\endoperationi

\newdimen\@kcharhalfwidth
\def\@checkspacelength{
\settowidth{\@kcharhalfwidth}{あ}
\divide\@kcharhalfwidth by 2
\@kcharhalfwidth=\@kcharhalfwidth}
{\catcode`\^^M=13\catcode`\ =13\gdef\nofold{\catcode`\
=13\catcode`\ =13\@checkspacelength\def\
{\hfill\\}\def {\hspace\@kcharhalfwidth}\tt}\catcode`\^^M=5\catcode`\ =10}

\font\eightRoman=cmr8
\font\tenRoman=cmr10
\font\twelveRoman=cmr12
\font\sixteenRoman=cmr10 scaled 1600
\font\twentyRoman=cmr10 scaled 2000

% combatibility between ASCII-jTeX and NTT-jTeX
\ifNTT{
\let\gt=\dg
\jfont\eightMincho=dm10 scaled 800
\jfont\tenMincho=dm10
\jfont\twelveMincho=dm10 scaled 1200
\jfont\sixteenMincho=dm10 scaled 1600
\jfont\twentyMincho=dm10 scaled 2000
\jfont\twelveGothic=dg10 scaled 1200
\jfont\fourteenGothic=dg10 scaled 1400
\def\kskip#1#2{\jintercharskip=0pt plus #1 minus 0pt
\jasciikanjiskip=1pt plus #2 minus 1pt\relax}
\else % ASCII JTeX
\font\eightMincho=min10 scaled 800
\font\tenMincho=min10
\font\twelveMincho=min10 scaled 1200
\font\sixteenMincho=min10 scaled 1600
\font\twentyMincho=min10 scaled 2000
\font\twelveGothic=goth10 scaled 1200
\font\fourteenGothic=goth10 scaled 1400
\def\kskip#1#2{\kanjiskip=0pt plus #1 minus 0pt
\xkanjiskip=1pt plus #2 minus 1pt\relax}
\fi
\kskip{10pt}{10pt}

% indent parameter
\settowidth{\parindent}{あ}

% other parameters
\newlength\boxcolwidth
\boxcolwidth=\textwidth
\advance\boxcolwidth by -15pt

\setcounter{topnumber}{8}
\def\topfraction{1.0}
\setcounter{bottomnumber}{5}
\def\bottomfraction{1.0}
\setcounter{totalnumber}{10}
\def\textfraction{0.01}
\def\floatpagefraction{1.0}
\setcounter{dbltopnumber}{8}
\def\dbltopfraction{0.99}
\def\dblfloatpagefraction{1.0}


% section styles (modified from article.sty)

\def\@makechapterhead#1{ \vspace*{50pt} { \parindent 0pt \raggedright 
 \ifnum \c@secnumdepth >\m@ne \Huge\gt\bf 
  \ifNTT \@chapapp \else \@chapapp{\thechapter}\fi \par 
 \vskip 20pt \fi \Huge \gt\bf #1\par 
 \nobreak \vskip 40pt } }

\def\@makeschapterhead#1{ \vspace*{50pt} { \parindent 0pt \raggedright 
 \Huge \gt\bf #1\par 
 \nobreak \vskip 40pt } }

\def\section{\@startsection {section}{1}{\z@}{3.5ex plus 1ex minus 
 .2ex}{2.3ex plus .2ex}{\LARGE\bf\gt}}
\def\subsection{\@startsection{subsection}{2}{\z@}{3.25ex plus 1ex minus 
 .2ex}{1.5ex plus .2ex}{\Large\bf\gt}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{3.25ex plus 
1ex minus .2ex}{1.5ex plus .2ex}{\large\bf\gt}}
\def\paragraph{\@startsection
 {paragraph}{4}{\z@}{3.25ex plus 1ex minus .2ex}{1.5ex plus 
.2ex}{\bf\gt}}
\def\subparagraph{\@startsection
 {subparagraph}{4}{\parindent}{3.25ex plus 1ex minus 
 .2ex}{-1em}{\normalsize\bf}}

% footnote
\def\thefootnote{\dag\arabic{footnote}}
\long\def\@makefntext#1{\parindent=1zw\noindent 
\@tempdima=\textwidth \advance\@tempdima by -3em
\hbox to 2em{\hfil\bf \@thefnmark:}%
\parbox[t]{\@tempdima}{#1}\hfil}
